<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
		attributeFormDefault="qualified"
		targetNamespace="http://api.whitepages.com/schema/"
		xmlns:wp="http://api.whitepages.com/schema/">
    <xs:element name="wp">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="wp:result"/>
                <xs:element minOccurs="0" ref="wp:errormessages"/>
                <xs:element minOccurs="0" ref="wp:meta"/>
                <xs:element minOccurs="0" ref="wp:listings"/>
                <xs:element minOccurs="0" ref="wp:options"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="result">
        <xs:complexType>
            <xs:attribute name="code" use="required" type="wp:responsecode"/>
            <xs:attribute name="message"/>
            <xs:attribute name="type" use="required" type="wp:responsetype"/>
        </xs:complexType>
    </xs:element>
    <xs:simpleType name="responsetype">
        <xs:restriction base="xs:string">
            <xs:enumeration value="success"/>
            <xs:enumeration value="error"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="responsecode">
        <xs:restriction base="xs:string">
            <xs:enumeration value="Found Data"/>
            <xs:enumeration value="No Data Found"/>
            <xs:enumeration value="Truncated Data"/>
            <xs:enumeration value="Error"/>
            <xs:enumeration value="Server Error"/>
            <xs:enumeration value="Invalid Input"/>
            <xs:enumeration value="Mismatched Input"/>
            <xs:enumeration value="Missing Input"/>
            <xs:enumeration value="Refine Input"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:element name="errormessages">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" ref="wp:message"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="message" type="xs:string"/>
    <xs:element name="meta">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="wp:linkexpiration"/>
                <xs:element ref="wp:recordrange"/>
                <xs:element ref="wp:apiversion"/>
                <xs:element ref="wp:searchlinks"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="linkexpiration" type="xs:date"/>
    <xs:element name="recordrange">
        <xs:complexType>
            <xs:attribute name="lastrecord" use="required" type="xs:integer"/>
            <xs:attribute name="firstrecord" use="required" type="xs:integer"/>
            <xs:attribute name="totalavailable" use="required" type="xs:integer"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="apiversion" type="xs:string"/>
    <xs:element name="searchlinks">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" ref="wp:link"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="listings">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="wp:listing"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="listing">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="wp:people"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="wp:business"/>
                <xs:element minOccurs="0" ref="wp:phonenumbers"/>
                <xs:element minOccurs="0" ref="wp:address"/>
                <xs:element minOccurs="0" ref="wp:geodata"/>
                <xs:element minOccurs="0" ref="wp:listingmeta"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="people">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" ref="wp:person"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="person">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="wp:firstname"/>
                <xs:element minOccurs="0" ref="wp:middlename"/>
                <xs:element ref="wp:lastname"/>
                <xs:element minOccurs="0" ref="wp:suffix"/>
            </xs:sequence>
            <xs:attribute name="rank" use="required" type="wp:rank"/>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="rank">
        <xs:restriction base="xs:string">
            <xs:enumeration value="primary"/>
            <xs:enumeration value="secondary"/>
            <xs:enumeration value="tertiary"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:element name="firstname" type="xs:string"/>
    <xs:element name="middlename" type="xs:string"/>
    <xs:element name="lastname" type="xs:string"/>
    <xs:element name="suffix" type="xs:string"/>
    <xs:element name="business">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="wp:businessname"/>
            </xs:sequence>
            <xs:attribute name="rank" use="required" type="wp:rank"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="businessname" type="xs:string"/>
    <xs:element name="phonenumbers">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" ref="wp:phone"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="phone">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="wp:fullphone"/>
                <xs:element minOccurs="0" ref="wp:areacode"/>
                <xs:element ref="wp:exchange"/>
                <xs:element ref="wp:linenumber"/>
                <xs:element minOccurs="0" ref="wp:carrier"/>
            </xs:sequence>
            <xs:attribute name="rank" use="required" type="wp:rank"/>
            <xs:attribute name="type" use="required" type="wp:listingtype"/>
            <xs:attribute name="carrier_only"        type="xs:boolean"/>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="listingtype">
        <xs:restriction base="xs:string">
            <xs:enumeration value="work"/>
            <xs:enumeration value="home"/>
            <xs:enumeration value="business"/>
            <xs:enumeration value="government"/>
            <xs:enumeration value="mobile"/>
            <xs:enumeration value="landline"/>
            <xs:enumeration value="pager"/>
            <xs:enumeration value="satellite"/>
            <xs:enumeration value="unknown"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:element name="fullphone" type="xs:string"/>
    <xs:element name="areacode" type="xs:string"/>
    <xs:element name="exchange" type="xs:string"/>
    <xs:element name="linenumber" type="xs:string"/>
    <xs:element name="carrier" type="xs:string"/>
    <xs:element name="address">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="wp:fullstreet"/>
                <xs:element minOccurs="0" ref="wp:house"/>
                <xs:element minOccurs="0" ref="wp:predir"/>
                <xs:element minOccurs="0" ref="wp:street"/>
                <xs:element minOccurs="0" ref="wp:postdir"/>
                <xs:element minOccurs="0" ref="wp:streettype"/>
                <xs:element minOccurs="0" ref="wp:aptnumber"/>
                <xs:element minOccurs="0" ref="wp:apttype"/>
                <xs:element minOccurs="0" ref="wp:city"/>
                <xs:element minOccurs="0" ref="wp:state"/>
                <xs:element minOccurs="0" ref="wp:zip"/>
                <xs:element minOccurs="0" ref="wp:zip4"/>
                <xs:element minOccurs="0" ref="wp:country"/>
            </xs:sequence>
            <xs:attribute name="deliverable" use="required" type="xs:boolean"/>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="country">
        <xs:restriction base="xs:string">
            <xs:enumeration value="US"/>
            <xs:enumeration value="CA"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:element name="fullstreet" type="xs:string"/>
    <xs:element name="house" type="xs:string"/>
    <xs:element name="predir" type="xs:string"/>
    <xs:element name="street" type="xs:string"/>
    <xs:element name="postdir" type="xs:string"/>
    <xs:element name="streettype" type="xs:string"/>
    <xs:element name="aptnumber" type="xs:string"/>
    <xs:element name="apttype" type="xs:string"/>
    <xs:element name="city" type="xs:string"/>
    <xs:element name="state" type="xs:string"/>
    <xs:element name="zip" type="xs:string"/>
    <xs:element name="zip4" type="xs:string"/>
    <xs:element name="country" type="wp:country"/>
    <xs:element name="geodata">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="wp:geoprecision"/>
                <xs:element ref="wp:latitude"/>
                <xs:element ref="wp:longitude"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="geoprecision" type="xs:integer"/>
    <xs:element name="latitude" type="xs:string"/>
    <xs:element name="longitude" type="xs:string"/>
    <xs:element name="listingmeta">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="wp:lastvalidated"/>
                <xs:element minOccurs="0" ref="wp:type"/>
                <xs:element ref="wp:moreinfolinks"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="lastvalidated" type="xs:string"/>
    <xs:element name="type" type="wp:listingtype"/>
    <xs:element name="moreinfolinks">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="wp:link"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="options">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" ref="wp:cityoption"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="cityoption">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="wp:refinesearchurl"/>
            </xs:sequence>
            <xs:attribute name="city" use="required" type="xs:string"/>
            <xs:attribute name="country" use="required" type="wp:country"/>
            <xs:attribute name="state" use="required" type="xs:string"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="refinesearchurl" type="xs:anyURI"/>
    <xs:element name="link">
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:anyURI">
                    <xs:attribute name="linktext" use="required" type="xs:string"/>
                    <xs:attribute name="type" use="required" type="wp:linktype"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    <xs:simpleType name="linktype">
        <xs:restriction base="xs:string">
            <xs:enumeration value="drivingdirections"/>
            <xs:enumeration value="findneighbors"/>
            <xs:enumeration value="homepage"/>
            <xs:enumeration value="viewdetails"/>
            <xs:enumeration value="viewmap"/>

            <xs:enumeration value="mapareacode"/>

            <xs:enumeration value="allresults"/>
            <xs:enumeration value="mapallresults"/>
            <xs:enumeration value="self"/>
            <xs:enumeration value="worklistings"/>

            <xs:enumeration value="viewsearchsuggestions"/>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>